load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//build:STRINGER.bzl", "stringer")

go_library(
    name = "pgwirebase",
    srcs = [
        "conn.go",
        "doc.go",
        "encoding.go",
        "msg.go",
        "too_big_error.go",
        ":gen-clientmessagetype-stringer",  # keep
        ":gen-formatcode-stringer",  # keep
        ":gen-pgnumericsign-stringer",  # keep
        ":gen-preparetype-stringer",  # keep
        ":gen-servererrfieldtype-stringer",  # keep
        ":gen-servermessagetype-stringer",  # keep
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgwirebase",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/geo",
        "//pkg/settings",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/lex",
        "//pkg/sql/oidext",
        "//pkg/sql/pgrepl/lsn",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/bitarray",
        "//pkg/util/duration",
        "//pkg/util/encoding",
        "//pkg/util/errorutil/unimplemented",
        "//pkg/util/ipaddr",
        "//pkg/util/json",
        "//pkg/util/timeofday",
        "//pkg/util/timetz",
        "//pkg/util/timeutil/pgdate",
        "//pkg/util/tsearch",
        "//pkg/util/uint128",
        "//pkg/util/uuid",
        "//pkg/util/vector",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_dustin_go_humanize//:go-humanize",
        "@com_github_lib_pq//oid",
    ],
)

stringer(
    name = "gen-pgnumericsign-stringer",
    src = "encoding.go",
    typ = "PGNumericSign",
)

stringer(
    name = "gen-formatcode-stringer",
    src = "encoding.go",
    typ = "FormatCode",
)

stringer(
    name = "gen-clientmessagetype-stringer",
    src = "msg.go",
    typ = "ClientMessageType",
)

stringer(
    name = "gen-servermessagetype-stringer",
    src = "msg.go",
    typ = "ServerMessageType",
)

stringer(
    name = "gen-servererrfieldtype-stringer",
    src = "msg.go",
    typ = "ServerErrFieldType",
)

stringer(
    name = "gen-preparetype-stringer",
    src = "msg.go",
    typ = "PrepareType",
)
